package com.hjf.ditubiaozhu.utils;

import android.util.Log;

import com.alibaba.fastjson.JSON;

/**
 * Created by hejianfeng on 17/3/19.
 * <p>
 * 万能打印l利器
 */

public class LogUtils {

    public static boolean isLogPrint = true;

    public synchronized static void e(Object... objects) {
        StringBuilder sb = new StringBuilder();
        for (Object obj : objects) {
            if (obj == null) continue;//如果对象是空,下面不执行
            sb.append(JSON.toJSONString(obj)).append("\n");
        }
        er(sb.toString());

    }
public static void main(String[] args){

}

    public static void er(String msg) {
        if (!isLogPrint) return;
        Log.e("LogUtils", "-----------------------  开始打印 --------------------------");
        Log.e("LogUtils", msg);
        Log.e("LogUtils", "-----------------------  打印完成 --------------------------");
    }

}
